<!DOCTYPE html>
<html>
<head>
<base href="{$site_url}/" />
<!-- Use IE7 mode -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>调箱平台-批量导入</title>
<meta name="description" content="普捷通" />
<meta name="keywords" content="普捷通|要箱|集港|疏港" />
<script type="text/javascript">
	//<!CDATA[
	var SITE_URL = "{$site_url}";
	var REAL_SITE_URL = "{$real_site_url}";
	var PRICE_FORMAT = '{$price_format}';
	//
</script>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link href="{res file=css/base.css}" rel="stylesheet" type="text/css" />
<link href="{res file=css/index.css}" rel="stylesheet" type="text/css" />
<link href="{res file=css/jquery.datetimepicker.css}" rel="stylesheet"
	type="text/css" />
<link href="{res file=css/jquery-ui.min.css}" rel="stylesheet"
	type="text/css" />
<script type="text/javascript" src="index.php?act=jslang"></script>
<script type="text/javascript" src="{lib file=jquery-1.8.3.min.js}"
	charset="utf-8"></script>
<script type="text/javascript"
	src="{lib file=jquery.datetimepicker.full.js}" charset="utf-8"></script>
<script type="text/javascript"
	src="{lib file=jquery-ui.min.js}" charset="utf-8"></script>
<script type="text/javascript"
	src="{lib file=jquery.cookie.js}" charset="utf-8"></script>
<!--[if lt IE 10]>
<script type="text/javascript" src="{lib file=PIE.js}"></script>
<![endif]-->
<script type="text/javascript">
function showsuc(sysmsg){
	if(sysmsg){
		$("#syss").text(sysmsg);
		$("#syss").slideDown();

		setTimeout(function(){
			$("#syss").slideUp();
		},2000);
	}
}

function showerror(sysmsg,id){
	if(sysmsg){
		$("#syse").text(sysmsg);
		$("#syse").slideDown();

		setTimeout(function(){
			$("#syse").slideUp();
		},2000);
	}
	if(id!=undefined){
		$("#"+id).addClass("form-item-error");
		$("#"+id).focus();
	}
}
function successRedirectURL(url){
	var isIE = !-[1,];
	if(isIE){
		var link = document.createElement("a");
		link.href = url;
		link.style.display = 'none';
		document.body.appendChild(link);
		link.target = "_top";
		link.click();
	}else{
		window.top.location = url;
	}
}

function validate() {

	var box_no=$("#box_no").val();
	
	if(box_no==undefined||box_no==null||box_no==""){
		showerror("请输入箱号","box_no");
		return false;
	}
	return true;
}

	$(function() {
		var sysmsg=$.cookie('sysmsg');
		var syst=$.cookie('syst');
		if(sysmsg!=undefined&&sysmsg!=null&&sysmsg!=""){
			if(syst=='notice'){
				$("#syss").text(sysmsg);
				$("#syss").slideDown();
				
				setTimeout(function(){
					$("#syss").slideUp();
				},2000);
			}else{
				$("#syse").text(sysmsg);
				$("#syse").show();
				
				setTimeout(function(){
					$("#syse").slideUp();
				},4000);
			}
			
			$.cookie('sysmsg','');
			$.cookie('syst','');
		}
		
		if (window.PIE) {
			$('.rounded').each(function() {
				PIE.attach(this);
			});
		}

		$('#bgn_dd').datetimepicker({value:"{$start}",step:10,lang:'ch',timepicker:false,format:'Y/m/d'});
		$('#end_dd').datetimepicker({value:"{$end}",step:10,lang:'ch',timepicker:false,format:'Y/m/d'});
		
		var busy=false;
		$("[id^='cancel_']").click(function() {
			var t=$(this);
			var n = $(this).attr("no");
			if (n != undefined&&n !="") {
				$("#mask").show();

				$("#mask").off("click");
				$("#mask").on("click", function() {
					$(this).hide();
				});

				$btnq = $("#q");
				$("#q").off("click");
				$("#q").on("click", function(e) {
					e.stopPropagation();
					if(busy){
						return false;
					}
					busy=true;
					var ajaxurl = '/index.php?';
					$.ajax({
						type: 'post',
						url: ajaxurl + location.search.substring(1),
						contentType: "application/x-www-form-urlencoded; charset=utf-8",
						data: {n:n,act:"cancel"},
						cache:false,
						beforeSend: function () {
							$btnq.text('正在取消..');
						},
						error: function () {
							busy=false;
							$("#mask").hide();
							showerror('网络繁忙，请稍后再试');
						},
						success: function (response) {
							busy=false;
							if (response) {
								try{
									var obj = eval(response);

									if (obj.success) {
										successRedirectURL(obj.success);
									}

									if (obj.info) {
										showerror(obj.info);
										$btnq.text('确定');
										$("#mask").hide();
									}
								}catch(e){
									showerror('发生错误，请重试');
									$btnq.text('确定');
									$("#mask").hide();
								}

							}
							$btnq.text('确定');
						}
					});
				});
			}
		});
		
		var busyyong=false;
		$("[id^='yong_']").click(function() {
			var t=$(this);
			var sn = $(this).attr("no");
			$("#box_no").val("");
			
			if (sn != undefined&&sn !="") {
				$("#n").val(sn);
				$("#maskyong").show();
				$("#yongarea").show();

				$("#cy").off("click");
				$("#cy").on("click", function() {
					$("#yongarea").hide();
					$("#maskyong").hide();
				});
				
				$("#box_no").off("click");
				$("#box_no").on("click",function(){
					$(this).removeClass("form-item-error");
				}).keydown(function(){
					$(this).removeClass("form-item-error");
				});
				
				
				$btnq = $("#qy");
				$("#qy").off("click");
				$("#qy").on("click", function(e) {
					e.stopPropagation();
					if(busyyong){
						return false;
					}
					
					if(validate()){
						busyyong=true;
						var param = $("#yongform").serialize();
						var ajaxurl = '/index.php?';
						$.ajax({
							type: 'post',
							url: ajaxurl + location.search.substring(1),
							contentType: "application/x-www-form-urlencoded; charset=utf-8",
							data: param,
							cache:false,
							beforeSend: function () {
								$btnq.text('正在提交..');
							},
							error: function () {
								busyyong=false;
								
								showerror('网络繁忙，请稍后再试');
							},
							success: function (response) {
								busyyong=false;
								if (response) {
									try{
										var obj = eval(response);
	
										if (obj.success) {
											successRedirectURL(obj.success);
										}
	
										if (obj.info) {
											showerror(obj.info);
											$btnq.text('确定');
											
										}
									}catch(e){
										showerror('发生错误，请重试');
										$btnq.text('确定');
										
									}
	
								}
								$btnq.text('确定');
							}
						});
					}
				});
			}
		});
		
		$("[stype='sort']").click(function(){
			var f=$(this).attr("f");
			var s=$(this).attr("s");
			
			window.location.href="/index.php?app=plan&k={$smarty.get.k}&page={$smarty.get.page}&f="+f+"&s="+s;
		});
		
		$("#box_no").autocomplete({
			source: function(request, response) {
                $.ajax({
                    url: "/index.php?app=plan&act=stock",
                    contentType : "application/x-www-form-urlencoded; charset=utf-8",
					data : {
						t : request.term,
						n:$("#n").val()
					},
                    success: function(data) {
                        response($.map($.parseJSON(data), function(item) {
                            return { label: item.box_no, value: item.box_no ,et:item.et_no}
                        }));
                    }
                });
            },
　　　　　	 select: function(event, ui) {
　　　　　		 $("#box_no").val(ui.item.label);
　　　　　		 $("#et_no").val(ui.item.et);
             	 $("#box_no").removeClass("form-item-error");
             	 return false;
            },
            change: function( event, ui ) {
            	if(ui.item!=null){
	            	$("#box_no").val(ui.item.label);
	            	$("#et_no").val(ui.item.et);
	             	$("#box_no").removeClass("form-item-error");
            	}else{
            		//$("#box_no").val("");
            	}
             	 return false;
            },
            minLength: 0, 
            autoFocus: false, 
		});
	});
</script>
{$_head_tags}

<style>
#box_no{    font-weight: bold;
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
    font-family: 微软雅黑;
    border: 1px solid #ccc;
    width: 223px;
    padding: 0 10px;
    height: 40px;
    line-height: 40px;
    background: url(/images/d.png) no-repeat 412px center;padding-right: 45px}
.ui-menu .ui-menu-item {
    font-size: 14px;
   
    padding: 2px;
   
}
 .ui-menu {
    background: #ededed;
    max-height: 400px;
    overflow: auto;
     z-index: 2222;
}
.searcharea {
	position: relative;
	padding: 7px;
	border: 1px solid #d6d6d6;
	border-radius: 30px;
	-moz-border-radius: 30px;
	-webkit-border-radius: 30px;
	margin-top: 0px;
}

.searcharea input {
	width: 250px;
}

.searcharea a {
	background: #3e7fc2;
	color: #fff;
	padding: 3px 8px;
	-moz-border-radius: 10px;
	-webkit-border-radius: 10px;
	border-radius: 10px;
}

.ship_item {
	margin-bottom: 20px
}

.tlist {
	width: 100%;
	font-size: 14px;
	background-color: #fff;
	text-align: center;
	border-spacing: 0;
	border: 1px solid #e7e7eb;
	border-left: 0;
	border-bottom: 0;
}

.tlist th {
	background: #f4f5f9;
	height: 40px;
	line-height: 40px;
	text-align: center;
	font-weight: normal;
	color: #222;
	border-bottom: 1px solid #e7e7eb;
	white-space: nowrap;
}

.tlist td {
	height: 50px;
	line-height: 50px;
	text-align: center;
	overflow: hidden;
	white-space: nowrap;
	color: #8d8d8d;
	border-bottom: 1px solid #e7e7eb;
}

.barright {
	padding: 20px 0
}

.w800 {
	width: 995px;
}

.barleft {
	height: 700px;
	overflow: hidden;
}

.barright {
	overflow: hidden;
	height: 700px;
}

.mcontent {
	width: 400px;
	height: 150px;
	background: #fff;
	margin: 0 auto;
	position: absolute;
	top: 50%;
	left: 50%;
	margin-top: -75px;
	margin-left: -200px;
	border-radius: 3px;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
}

.mfoot a {
	position: absolute;
	width: 50%;
	bottom: 0;
	text-align: center;
	height: 50px;
	line-height: 50px;
	font-size: 14px;
	color: #fff
}

.q {
	right: 0;
	background: #3e7fc2;
}

.mfoot a:hover {
	font-size: 18px;
	text-decoration: none
}

.c {
	background: #ccc
}

.mhead {
	font-size: 16px;
	text-align: center;
	line-height: 100px
}
.labal {
	width: 100px;
}

.labalrow {
	height: 42px;
	line-height: 42px;
	font-size: 14px;
	color: #999
}

.labalfor {
	margin-top: 10px
}

.labalfor li {
	float: left;
	width: 80px;
	height: 30px;
	line-height: 30px;
	text-align: center;
	border: 1px solid #ccc;
	margin-right: 10px;
	cursor: pointer;
	margin-bottom: 10px;
}
.lefttab{margin: 10px 0 0 10px}
.lefttab a{font-size: 16px;border-bottom: 3px solid #ccc;color: #ccc;padding: 0 15px 10px 15px}
.lefttab .on{border-bottom: 3px solid #3e7fc2;color: #3e7fc2}
</style>
</head>
<div id="syss" class="syss rounded">操作成功</div>
<div id="syse" class="syse rounded">操作失败</div>
<div class="mask" id="mask">
	<div class="mcontent">
		<div class="mhead">确认要取消此要箱？</div>
		<div class="mfoot">
			<a href="javascript:;" class="c" id="c">取消</a> <a href="javascript:;"
				class="q" id="q">确定</a>
		</div>
	</div>
</div>

<div class="mask" id="maskyong">
</div>
<div style="position: absolute;
    height: 150px;
    width: 320px;
    background: #fff;
       border-radius: 3px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    top: 50%;
    margin-top: -150px;
    left: 50%;
    margin-left: -160px;z-index: 101;display: none" id="yongarea">
    <form id="yongform">
    	<input type="hidden" name="act" value="box" /> 
			<input type="hidden" name="n" value="" id="n"/> 
<div style="padding: 20px">
	<input type="text" value="" id="box_no" name="box_no" placeholder="请输入箱号">
	<input type="hidden" value="" id="et_no" name="et_no" >	
	</div>
	<div class="mfoot">
			<a href="javascript:;" class="c" id="cy">取消</a> <a href="javascript:;"
				class="q" id="qy">确定</a>
		</div></form>
		</div>
<body>
	<div class="topbar">
		<div class="w">
			<div class="fr">
				<!--{if !$visitor.user_id}-->
				<a href="{url app=member&act=login&ret_url=$ret_url}"
					style="color: #C81623">请登录</a>
				<div class="spacer"></div>
				<a href="{url app=member&act=register&ret_url=$ret_url}">免费注册</a>
				<!--{else}-->

				欢迎您登陆!&nbsp;&nbsp;{$visitor.real_name|escape}

				<div class="spacer"></div>
				<a href="{url app=member&act=setpwd}">修改密码</a>
				<div class="spacer"></div>
				<a href="{url app=member&act=logout}">{$lang.logout}</a>
				<!--{/if}-->
			</div>

			<div class="cl"></div>
		</div>
	</div>
	<div style="position: relative;" class="submain">
		<div class="w">
			<div id="logoindex" class="fl">
				<a href="index.php"><img
					src="themes/mall/default/styles/default/images/logo1.png"> </a>
			</div>
			<ul class="navbar fr" style="position: relative;">
				<li><a href="index.php"><p>首页</p> </a></li>
				<li><a class="on" href="index.php?app=sl&act=ofast"><p>集运</p> </a></li>
				<li><a href="javascript:;"><p>堆场</p> </a></li>
				<li><a href="javascript:;"><p>报关</p> </a></li>
				<li><a href="javascript:;"><p>促销专区</p> </a></li>
			</ul>
			<div class="cl"></div>
		</div>
		<div class="cl"></div>
	</div>
	<div class="w">
		<div class="fl w150 barleft">
			<ul class="navbarleft">
				<li><a href="index.php?app=sl&act=pfast">计划要箱</a></li>
				<li><a href="index.php?app=sl&act=ofast">一键要箱</a>
				</li>
				<li><a href="index.php?app=plan&act=fast">快速要箱</a>
				</li>
				<li class="de"><a href="index.php?app=plan">订单确认</a></li>
				<li class="kx"><a href="index.php?app=plan" class="on">空箱</a>
				</li>
				<li class="zx"><a href="index.php?app=containerplan">重箱</a>
				</li>
				<li><a href="index.php?app=plan&act=wl">查看物流</a>
				</li>
				<li><a href="index.php?app=plan&act=fee">账单明细</a>
				</li>
				<li style="display: none"><a href="index.php?app=plan&act=fast">快速要箱</a>
				</li>
			
				<li style="display: none"><a href="index.php?app=usebox">状态查询</a></li>
				<li style="display: none"><a href="index.php?app=plan&act=fang">放单查询</a></li>
				<li style="display: none"><a href="index.php?app=plan&act=wsearch">提单查询</a></li>
			</ul>
			<div class="cl"></div>
		</div>
		<div class="fl w800 barright">
			<div class="fl lefttab">
			<a href="index.php?app=plan">空箱</a><a href="index.php?app=plan&act=p">当前盘存</a><a href="index.php?app=plan&act=import" class="on">批量导入</a><a href="index.php?app=plan&act=b">查看箱号</a>
			</div>
			
			<div class="cl"></div>
			<div class="ship_area">
				<form method="post" enctype="multipart/form-data">
        <table class="infoTable">
            <tr>
                <th class="paddingT15">{$lang.select_file}:</th>
                <td class="paddingT15 wordSpacing5">
                    <input type="file" name="file_card" id="file_card"/>
                </td>
            </tr>
            <tr>
                <th></th>
                <td class="ptb20">
                    <input class="formbtn fl" type="submit" name="Submit" value="{$lang.import}"/><em style="color: #EE0000;
    line-height: 18px;
    display: block;
    width: 340px;
    margin-left: 20px;
    float: left;">* 温馨提示：请下载模板！按模板列填写内容：船公司编号、箱型、箱量、船名、航次、提单号不可以为空；最晚用箱时间填写时间格式(例:2016/11/30 18:00)；如果加急请填写"Y"。</em> <a target="_blank" href="{$site_url}/2007.xlsx" class="bnt">下载模版</a>
                </td>
            </tr>
        </table>
    </form><style>
    .bnt{
    display:block;
    float:left;
        font-size: 14px;
      
        line-height: 55px;
        color: #3e7fc2 !important;
        font-weight: normal !important;
        margin-left: 20px !important;
    }
    .bnt:hover{
        color: #fff;
    }
    .infoTable{
        padding: 0px;
    }
    .infoTable {
    width: 95%;
    color: #444;
    margin: 0 auto;
    padding: 20px 0;
    background: #fff;
}

.infoTable  th {
    font-size: 14px;
    font-weight: normal;
    font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 宋体;
}
.infoTable  th {
    text-align: right;
    width: 120px;
    /* height: 35px; */
    height: 30px;
    line-height: 30px;
}
.infoTable  td {
    height: 30px;
    line-height: 30px;
    position: relative;
}
.wordSpacing5 {
    word-spacing: 5px;
}
.infoTable .formbtn {
       width: 200px;
    height: 54px;
    color: #fff;
    background: #3e7fc2;
    border: 0;
    font-size: 16px;
    font-family: "Microsoft YaHei", "Hiragino Sans GB";
    cursor: pointer;
}
</style>
   
				<div class="cl"></div>
			</div>
		</div>
		<div class="cl"></div>
	</div>
	<div class="w">
		<div id="footer-2013" style="margin-top: 50px">

			<div class="copyright">
				Copyright&copy;2004-2020&nbsp;&nbsp;普捷通&nbsp;版权所有</div>
				<div style="width:300px;margin:0 auto;">
		 		<a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=31011502002931" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img src="/themes/mall/default/ba.png" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">沪公网安备 31011502002931号</p></a>
		 	</div>
		</div>
	</div>

</body>
</html>